<template>
	<div id="SickChickenDateChart"></div>
</template>

<script setup>
	import { onMounted } from 'vue'
	import { Line } from '@antv/g2plot'
	import chartApi from "@/api/chart/chartApi";

	onMounted(() => {

		chartApi.sickChickenDateData()
			.then(res =>{
				// const data = Object.assign({},res);
				const data = res;
				console.log(data);
				const line = new Line('SickChickenDateChart', {
					data,
					padding: 'auto',
					xField: 'date',
					yField: 'value',
					xAxis: {
						type: 'timeCat',
						tickCount: 5
					}
				})

				line.render()
			})

	})
</script>
